﻿package {
	import com.janisRadins.asDraw.CubicCurve;
	import com.janisRadins.asDraw.SVGPathParser;
	import flash.display.Sprite;
	import flash.geom.Point;
	import mx.utils.ObjectUtil;
	
	/**
	 * ...
	 * @author Jānis Radiņš
	 */
	public class T4 extends Sprite {
		public function T4() {
			/*//var curve:CubicCurve = new CubicCurve(
				//350, 100,
				//30, 530,
				//130, 30,
				//310, 100
			//);
			
			var curve:CubicCurve = new CubicCurve(
				558,495.36218,
				554.08848, 496.66602,
				561, 503.23908,
				561,507.36218 
			);
			 	
			//C 561, 533.36218, 561, 559.36218, 561, 585.36218"
			
			for (var t:Number = 0; t <= 1; t += 0.1) {
				var p:Point = curve.getPoint(t);
				graphics.beginFill(0xFF0000);
				graphics.drawCircle(p.x, p.y, 2)
				graphics.endFill();
			}
			
			var quads:Array = curve.quadratics;
			graphics.lineStyle(1, 0x123456);
			graphics.moveTo(curve.p1x, curve.p1y);
			for each(var c:Array in quads) {
				graphics.curveTo(c[2], c[3], c[4], c[5]);
			}
			*/
			var str:String = "M 570,618.36218 \n";
			str += "C \n";
			str += "570,		621.38064 \n";
			str += "570.66667,	624.36218 \n";
			str += "571,		627.36218 \n";
			str += "C 571.63545,633.08121 572.06885,614.43103 568,610.36218\n";
			var svg:SVGPathParser = new SVGPathParser();
			//svg.parse("M 570,618.36218 C 570,621.38064 570.66667,624.36218 571,627.36218 C 571.63545,633.08121 572.06885,614.43103 568,610.36218 C 566.05635,608.41853 569.33333,615.69552 570,618.36218 C 570.5198,620.44139 570,600.42698 570,618.36218 C 570,636.52529 580.63854,611.10677 560,619.36218 C 558.68694,619.88741 562,621.36218 563,622.36218");
			svg.parse(str);
		}
	}
	
}